#include <stdio.h>

void twoSum(int nums[], int target, int n) {
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (nums[i] + nums[j] == target) {
                printf("The two numbers are %d and %d\n", nums[i], nums[j]);
                printf("Their indices are %d and %d\n", i, j);
                return;
            }
        }
    }

    printf("No solution found.\n");
}

int main() {
    int n;
    printf("Enter the size of the array: ");
    scanf("%d", &n);

    int nums[n];
    printf("Enter the elements of the array: ");
    for (int i = 0; i < n; i++) {
        scanf("%d", &nums[i]);
    }

    int target;
    printf("Enter the target sum: ");
    scanf("%d", &target);

    twoSum(nums, target, n);

    return 0;
}